3.9.99 \(\int (a+i a \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx\) [899]

Optimal. Leaf size=25 \[ \frac {i a (c-i c \tan (e+f x))^2}{2 f} \]

[Out]

1/2*I*a*(c-I*c*tan(f*x+e))^2/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 36, normalized size of antiderivative = 1.44, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3603, 3567, 3852, 8} \begin {gather*} \frac {a c^2 \tan (e+f x)}{f}-\frac {i a c^2 \sec ^2(e+f x)}{2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

((-1/2*I)*a*c^2*Sec[e + f*x]^2)/f + (a*c^2*Tan[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx &=(a c) \int \sec ^2(e+f x) (c-i c \tan (e+f x)) \, dx\\ &=-\frac {i a c^2 \sec ^2(e+f x)}{2 f}+\left (a c^2\right ) \int \sec ^2(e+f x) \, dx\\ &=-\frac {i a c^2 \sec ^2(e+f x)}{2 f}-\frac {\left (a c^2\right ) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{f}\\ &=-\frac {i a c^2 \sec ^2(e+f x)}{2 f}+\frac {a c^2 \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.16, size = 45, normalized size = 1.80 \begin {gather*} \frac {a c^2 \left (2 f x-2 \text {ArcTan}(\tan (e+f x))+2 \tan (e+f x)-i \tan ^2(e+f x)\right )}{2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a*c^2*(2*f*x - 2*ArcTan[Tan[e + f*x]] + 2*Tan[e + f*x] - I*Tan[e + f*x]^2))/(2*f)

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 31, normalized size = 1.24

method result size
risch \(\frac {2 i a \,c^{2}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}\) \(24\)
derivativedivides \(-\frac {i a \,c^{2} \left (\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}+i \tan \left (f x +e \right )\right )}{f}\) \(31\)
default \(-\frac {i a \,c^{2} \left (\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}+i \tan \left (f x +e \right )\right )}{f}\) \(31\)
norman \(\frac {a \,c^{2} \tan \left (f x +e \right )}{f}-\frac {i a \,c^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

-I/f*a*c^2*(1/2*tan(f*x+e)^2+I*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.55, size = 34, normalized size = 1.36 \begin {gather*} \frac {-i \, a c^{2} \tan \left (f x + e\right )^{2} + 2 \, a c^{2} \tan \left (f x + e\right )}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/2*(-I*a*c^2*tan(f*x + e)^2 + 2*a*c^2*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 1.48, size = 35, normalized size = 1.40 \begin {gather*} \frac {2 i \, a c^{2}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

2*I*a*c^2/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (19) = 38\).
time = 0.12, size = 44, normalized size = 1.76 \begin {gather*} \frac {2 i a c^{2}}{f e^{4 i e} e^{4 i f x} + 2 f e^{2 i e} e^{2 i f x} + f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))**2,x)

[Out]

2*I*a*c**2/(f*exp(4*I*e)*exp(4*I*f*x) + 2*f*exp(2*I*e)*exp(2*I*f*x) + f)

________________________________________________________________________________________

Giac [A]
time = 0.50, size = 35, normalized size = 1.40 \begin {gather*} \frac {2 i \, a c^{2}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

2*I*a*c^2/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Mupad [B]
time = 4.54, size = 26, normalized size = 1.04 \begin {gather*} -\frac {a\,c^2\,\mathrm {tan}\left (e+f\,x\right )\,\left (-2+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}{2\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)^2,x)

[Out]

-(a*c^2*tan(e + f*x)*(tan(e + f*x)*1i - 2))/(2*f)

________________________________________________________________________________________